{extends file='layout/front.html'}

{block name='main'}
		<div class="main_t">
			<ul class="main_tab">
				<li><a href="account.html"><span>帐户管理</span></a></li>
				<li><a href="#" onclick="return false" class="current"><span>密码修改</span></a></li>
			</ul>
		</div>
		<div class="main_c">
			<ul class="form">
				<li class="mt20">
					<label><span class="title">原始密码</span><span class="text psw">
						<input type="text" class="password_text" value="输入您的原始密码">
						<input id="old" type="password" value="" class="password" style="display:none">
						</span></label>
				</li>
				<li class="line"><div></div></li>
				<li>
					<label><span class="title">新密码</span><span class="text psw">
						<input type="text" class="password_text" value="输入您的新密码">
						<input id="ne" type="password" value="" class="password" style="display:none">
						</span></label>
				</li>
				<li class="mb20">
					<label><span class="title">确认密码</span><span class="text psw">
						<input type="text" class="password_text" value="输入您的新密码">
						<input id="com" type="password" value="" class="password" style="display:none">
						</span></label>
				</li>
				<li>
					<div class="btn_save">
						<input id="save" type="button" value=" ">
					</div>
				</li>
			</ul>
		</div>
<script>
    $(":button").click(function(){
        old = $("#old").val();
        ne = $("#ne").val();        
        com = $("#com").val();
        
        $.post(SITE_URL+'/ajax/password.html', { ne:ne, old:old, com:com}, function(data){
	       if (data == '0') {
	         show_msg('请重新登录', function(){
	            location.href = SITE_URL+'/login.html';
	         });
	       }else if(data == '1') {
	         show_msg('修改成功', function(){}, "success");
	       }else{
	        show_msg(data);
	       }
	     });
    });
</script>
{/block} 
